package com.dj.mingkong.admin.biz.repository.database.music;

import com.dj.mingkong.common.infrastructure.base.dto.query.QueryVo;
import com.dj.mingkong.common.infrastructure.base.repository.BaseDatabaseRepository;
import com.dj.mingkong.common.infrastructure.eo.database.music.AlbumMusicEo;
import com.dj.mingkong.admin.biz.repository.database.music.mapper.AlbumMusicMapper;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * 专辑音乐Repository
 *
 * @author zenglonghui
 * @date: 2022/5/17 19:21
 */
@Repository
public class AlbumMusicRepository extends BaseDatabaseRepository<AlbumMusicMapper, AlbumMusicEo, QueryVo> {
    public boolean deleteByAlbumId(Long albumId) {
        return lambdaUpdate().eq(AlbumMusicEo::getAlbumId, albumId).remove();
    }

    public List<AlbumMusicEo> listByMusicId(Long musicId) {
        return lambdaQuery().eq(AlbumMusicEo::getMusicId, musicId).list();
    }

    public boolean deleteByMusicId(Long musicId) {
        return lambdaUpdate().eq(AlbumMusicEo::getMusicId, musicId).remove();
    }
}
